package com.suyl.candy.model.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suyl.candy.model.controller.BussAccountController;
import com.suyl.candy.model.entity.BussAccount;
import com.suyl.candy.model.entity.StatisticsAccount;
import com.suyl.candy.model.mapper.BussAccountMapper;
import com.suyl.candy.model.service.BussAccountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author suyl
 * @since 2020-04-21
 */
@Service
public class BussAccountServiceImpl extends ServiceImpl<BussAccountMapper, BussAccount> implements BussAccountService {

    private Logger log = LoggerFactory.getLogger(BussAccountServiceImpl.class);
    @Override
    public BigDecimal getTotalLoans() {
        log.info("===================");
        return baseMapper.getTotalLoans();
    }

    @Override
    public BigDecimal getTotalAmountRepaid() {
        return baseMapper.getTotalAmountRepaid();
    }

    @Override
    public BigDecimal getTotalLoansMonth() {
        return baseMapper.getTotalLoansMonth();
    }

    @Override
    public BigDecimal getTotalAmountRepaidMonth() {
        return baseMapper.getTotalAmountRepaidMonth();
    }

    @Override
    public List<StatisticsAccount> getTotalAmountRepaidByType() {
        return baseMapper.getTotalAmountRepaidByType();
    }

    @Override
    public List<StatisticsAccount> getTotalAmountNotByType() {
        return baseMapper.getTotalAmountNotByType();
    }

    @Override
    public List<StatisticsAccount> getByMonth() {
        return baseMapper.getByMonth();
    }

    @Override
    public List<StatisticsAccount> getTotalAmountRepaidByMonth() {
        return baseMapper.getTotalAmountRepaidByMonth();
    }

    @Override
    public List<StatisticsAccount> getTotalAmountNotByMonth() {
        return baseMapper.getTotalAmountNotByMonth();
    }

    @Override
    public List<BussAccount> getLatelyNNot(int times) {
        return baseMapper.getLatelyNNot(times);
    }

    @Override
    public List<BussAccount> getLately(int times) {
        return baseMapper.getLately(times);
    }

    @Override
    public List<StatisticsAccount> getCurrentMonthGroupByType() {
        return baseMapper.getCurrentMonthGroupByType();
    }
}
